/*
 *  Domain.h
 *  T3nsors
 *
 *  Created by Michael Barriault on 10-09-23.
 *  Copyright 2010 MikBarr Studios. All rights reserved.
 *
 */

#pragma once

#include <vector>

namespace T3 {
	class Domain {
	private:
		std::vector<int> O;
		std::vector<double> r;
		std::vector<double> D;
		std::vector<short> P;
	public:
		int x,N;
		Domain(void);
		Domain(int,...);
		int operator()(int);
//		int operator()(void);
//		int upto(int);
		int upto(int A) {
			if ( A == -1 ) return 1;
			int T = 1;
			for ( int i=0; i<A+1; i++ ) T *= O[i];
			return T;
		}
		
		int operator()(void) {
			return upto(N-1);
		}
		double min(int);
		double max(int);
		double d(int);
		double d(void);
		short& p(int);
	};
}

T3::Domain Merge(T3::Domain,T3::Domain);
void CheckDims(T3::Domain,T3::Domain);
void CheckDims(int,int);
